In many computing systems, low level instruction code is used as an intermediary between the hardware components of the computing system and the operating software and other high level software executing on the computing system. In some computer systems, this low level instruction code is known as the Basic Input and Output System (“BIOS”). The BIOS provides a set of software routines that allow high level software to interact with the hardware components of the computing system using standard calls.
Because of limitations of the BIOS in many PC-compatible computers, a new specification for creating the firmware that is responsible for booting the computer and for intermediating the communication between the operating system and the hardware has been proposed. The new specification is called the Extensible Firmware Interface (“EFI”) specification and is available from INTEL CORPORATION.
The EFI specification describes an interface between the operating system and the system firmware. In particular, the EFI specification defines the interface that platform firmware must implement and the interface that the operating system may use in booting. How the firmware implements the interface is left up to the manufacturer of the firmware. The EFI specification provides protocols for EFI drivers to communicate with each other, and the EFI core provides functions such as allocation of memory, creating events, setting the clock, and many others. This is accomplished through a formal and complete abstract specification of the software-visible interface presented to the operating system by the platform and the firmware.
The EFI is capable of providing services to other applications. Services are implemented by modules that may be loaded by a boot loader when the EFI is started. The services may provide low level input output services, mass storage device access services, simple text output services, and others. Each of these modules may have a need to store and retrieve various types of variables. As a result, the EFI specification requires that a service also be provided for storing and retrieving variables. Variables are defined as key/value pairs that consist of identifying information plus attributes (the key) and arbitrary data (the value). Variables within the EFI platform are intended for use as a means to store data that is passed between the EFI environment in the platform and EFI OS loaders and other applications that run in the EFI environment. The EFI specification does not define how the variable services should be implemented.
The EFI specification also specifies that variables must be persistent in most cases. This implies that the EFI implementation on a platform must operate so that variables passed in for storage are retained and available for use each time the computer system boots, at least until they are explicitly deleted or overwritten. In many computer systems, a non-volatile random access memory (“NVRAM”) is utilized to persistently store data such as system configuration information. The NVRAM may also be utilized to store variables between system boots in an EFI environment. However, the amount of NVRAM typically available in a computer system is very limited. Accordingly, it is necessary to make efficient use of available NVRAM when storing EFI variables. Moreover, because erase operations take a long time to perform on non-volatile memory devices, it is necessary to reduce the amount of erase operations during the variable storage and retrieval process.
It is with respect to these considerations and others that the various embodiments of the invention have been made.